/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JobSociety.java
 *
 * Created on 17/11/2011, 12:23:14 AM
 */
package Interface;

import Dominio.Controladora;
import java.awt.Graphics;
import java.awt.Image;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Agustin
 */
public class JobSociety extends javax.swing.JFrame {

    /** Creates new form JobSociety */
    public JobSociety() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
        this.paint(null);
        initComponents();
        this.setLocationRelativeTo(null);
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
        Date fecha = new Date();
        System.out.println(formato.format(fecha));
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        SwingUtilities.updateComponentTreeUI(this);
        this.pack();
        assignImage();
        Controladora.getInstance().actualizar();
        this.setContentPane(contenedor);

    }
    private final JPanelConFondo contenedor = new JPanelConFondo();

    public final void assignImage() {
        ClassLoader cldr = this.getClass().getClassLoader();
        java.net.URL imageURL = cldr.getResource("Interface/055"
                + ".jpg");
        System.out.println(imageURL);
        Image image = new ImageIcon(imageURL).getImage();
        contenedor.setImagen(image);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        mUsuario = new javax.swing.JMenu();
        miABMUsuario = new javax.swing.JMenuItem();
        mEmpresa = new javax.swing.JMenu();
        miABMEmpresa = new javax.swing.JMenuItem();
        mListados = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        mEspecialidad = new javax.swing.JMenu();
        miAltaEspecialidad = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Job-Society");
        setBackground(new java.awt.Color(153, 204, 255));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        mUsuario.setText("Usuarios");

        miABMUsuario.setText("ABM Usuario");
        miABMUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miABMUsuarioActionPerformed(evt);
            }
        });
        mUsuario.add(miABMUsuario);

        jMenuBar1.add(mUsuario);

        mEmpresa.setText("Empresas");

        miABMEmpresa.setText("ABM Empresa");
        miABMEmpresa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miABMEmpresaActionPerformed(evt);
            }
        });
        mEmpresa.add(miABMEmpresa);

        jMenuBar1.add(mEmpresa);

        mListados.setText("Listados");

        jMenuItem2.setText("Listados");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        mListados.add(jMenuItem2);

        jMenuBar1.add(mListados);

        mEspecialidad.setText("Especialidades");

        miAltaEspecialidad.setText("Alta");
        miAltaEspecialidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miAltaEspecialidadActionPerformed(evt);
            }
        });
        mEspecialidad.add(miAltaEspecialidad);

        jMenuItem1.setText("Especialidad + Calificada");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        mEspecialidad.add(jMenuItem1);

        jMenuBar1.add(mEspecialidad);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 891, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 559, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void miAltaEspecialidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miAltaEspecialidadActionPerformed
        AltaEspecialidad.getInstance().setVisible(true);
    }//GEN-LAST:event_miAltaEspecialidadActionPerformed

    private void miABMUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miABMUsuarioActionPerformed
        ABMUsuario.getInstance().setVisible(true);
    }//GEN-LAST:event_miABMUsuarioActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        EspecialiadMasCalificada.getInstance().setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void miABMEmpresaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miABMEmpresaActionPerformed
        ABMEmpresa.getInstance().setVisible(true);
    }//GEN-LAST:event_miABMEmpresaActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        Listados.getInstance().setVisible(true);

    }//GEN-LAST:event_jMenuItem2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                try {
                    new JobSociety().setVisible(true);
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(JobSociety.class.getName()).log(Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    Logger.getLogger(JobSociety.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(JobSociety.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(JobSociety.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenu mEmpresa;
    private javax.swing.JMenu mEspecialidad;
    private javax.swing.JMenu mListados;
    private javax.swing.JMenu mUsuario;
    private javax.swing.JMenuItem miABMEmpresa;
    private javax.swing.JMenuItem miABMUsuario;
    private javax.swing.JMenuItem miAltaEspecialidad;
    // End of variables declaration//GEN-END:variables
}
